package ru.budget.mobile.ui.base

import ru.budget.mobile.ui.entities.MyDate
import java.text.SimpleDateFormat
import java.time.format.DateTimeFormatter
import java.util.*

class DateTimeFormatter {
    private val dateAndTime = SimpleDateFormat("dd.MM.yyyy", Locale.getDefault())
    private val day = SimpleDateFormat("dd", Locale.getDefault())
    private val month = SimpleDateFormat("MM", Locale.getDefault())
    private val year = SimpleDateFormat("yyyy", Locale.getDefault())

    fun setDateAndTime(millis: Long): MyDate =
        MyDate(
            day = day.format(Date(millis)),
            month = month.format(Date(millis)),
            year = year.format(Date(millis))
        )
}
